package com.jsjosem.aftersales.request;

import androidx.core.util.Consumer;

import com.jsjosem.aftersales.api.CustomerApi;
import com.jsjosem.aftersales.data.response.CustomerResponse;
import com.jsjosem.aftersales.data.response.PageResponse;

import retrofit2.Call;

public class CustomerRequest extends AsyncRequest<PageResponse<CustomerResponse>> {

    public void customers(int page, int limit,String keyword, Consumer<PageResponse<CustomerResponse>> success, Consumer<? super Object> failed) {
        CustomerApi request = retrofit.create(CustomerApi.class);
        Call<PageResponse<CustomerResponse>> customers = request.customers(page, limit,keyword);
        sendRequest(customers, success, failed);
    }


}
